package com.ruoyi.parent.domain;

import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import com.ruoyi.common.core.domain.entity.SysUser;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

/**
 * 家长管理对象
 *
 * @author ruoyi
 * @date 2024-10-17
 */

public class ParentVo extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 家长ID
     */
    @Excel(name = "家长ID")
    private Long id;

    /**
     * 家长昵称
     */
    @Excel(name = "家长昵称")
    private String nickName;

    /**
     * 家长用户名
     */
    @Excel(name = "家长用户名")
    private String userName;

    /**
     * 家长名
     */
    @Excel(name = "家长名")
    private String patriarchName;

    /**
     * 密码
     */
    @Excel(name = "密码")
    private String password;

    /**
     * 联系电话
     */
    @Excel(name = "联系电话")
    private String phone;

    /**
     * 家长状态
     */
    @Excel(name = "家长状态", readConverterExp = "0=正常,1=停用")
    private String status;

    public static SysUser Convert(ParentVo parentVo) {
        SysUser sysUser = new SysUser();
        sysUser.setUserId(parentVo.getId());
        sysUser.setNickName(parentVo.getNickName());
        sysUser.setUserName(parentVo.getUserName());
        sysUser.setRealName(parentVo.getPatriarchName());
        sysUser.setPassword(parentVo.getPassword());
        sysUser.setPhonenumber(parentVo.getPhone());
        sysUser.setStatus(parentVo.getStatus());
        sysUser.setCreateTime(parentVo.getCreateTime());
        sysUser.setUpdateTime(parentVo.getUpdateTime());
        sysUser.setCreateBy(parentVo.getCreateBy());
        sysUser.setUpdateBy(parentVo.getUpdateBy());
        return sysUser;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getPatriarchName() {
        return patriarchName;
    }

    public void setPatriarchName(String patriarchName) {
        this.patriarchName = patriarchName;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("nickName", getNickName())
                .append("userName", getUserName())
                .append("patriarchName", getPatriarchName())
                .append("password", getPassword())
                .append("phone", getPhone())
                .append("status", getStatus())
                .append("createBy", getCreateBy())
                .append("updateBy", getUpdateBy())
                .append("createTime", getCreateTime())
                .append("updateTime", getUpdateTime())
                .toString();
    }


}
